home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 19
/
CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso
/
CUCD
/
Utilities
/
Scion
/
ARexx
/
Witness.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1997-09-24
|
9KB
|
177 lines
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/* Extraction of "Witness" data for Ted Wildy's index */
/* ================================================== */
/* script Witness.rexx */
/* */
/* Ted Wildy (NZ) is accumulating UK marriages, indexed on WITNESSES. */
/* This seems to me to be an excellent idea, to which as many of us as */
/* possible should contribute. */
/* This script reads your Scion Family records and tries to construct */
/* records for inclusion in the Index, writing its output to the file */
/* RAM:Witnesses, where you can edit it as required before submission. */
/* Of course, the Scion database must be running for the script to work. */
/* */
/* The format of a single four-line file record in the existing files */
/* (which this script tries to reproduce) is: */
/* */
/* Witness-Forenames Witness-SURNAME date Church */
/* Husband-Forenames Husband-SURNAME Town XXX */
/* Wife----Forenames Wife----SURNAME your-FHS/member-number */
/* your full name and address (for contact) */
/* */
/* where XXX represents the UK County code. */
/* */
/* Note that one marriage may have several witnesses: the script must */
/* convert the marriage into several records, one per witness. */
/* */
/* Your Family History Society name and membership number are included */
/* for contact in case you change your address. If you do not belong to */
/* a Society they should be left blank. */
/* */
/* As supplied, the script expects the witnesses in Scion's Witness field */
/* to be separated by commas or semicolons -- it uses TRANSLATE to change */
/* semis to commas before splitting the field up. You can, of course, */
/* make any alterations you want, but fullstops are not good separators, */
/* as they may be used with initials within witness-names. */
/* */
/* Since you may wish to run the script more than once as you build up */
/* your database, and since it is best not to send several copies of the */
/* same witnesses to the index, I have arranged that if the first char in */
/* the Scion Witness field is an asterisk (*) that wedding is ignored. */
/* If anyone wants the _script_ to insert the asterisk, let me know. */
/* */
/* There are, unfortunately, some insuperable problems requiring user */
/* intervention -- this means YOU :-) */
/* */
/* 1. Since the Scion "Wedding Place" field is free-form, I can't extract */
/* the separate "Church" and "Town" info required. The best I can do */
/* is to insert the "Wedding Place" field (or most of it) in BOTH */
/* positions, leaving you to edit the results later. */
/* If the "Wedding Place" field is empty, I force "Parish Church?" */
/* into the "Church" info area. */
/* 2. Without a complete built-in gazetteer of UK, I cannot automate the */
/* "County" code. I've done what I can, as you will see if/when you */
/* run the script, but once per marriage it may be a bit irritating. */
/* 3. There's a potential problem with the marriage date. It's probably */
/* fair to assume that if you know the witnesses you also know the */
/* exact date, but the Index wants it in fixed form, ie DDMMMYYYY: no */
/* spaces, and a non-significant zero, whereas Scion is less fussy. */
/* This script assumes that you've used the format D(D) MMM YYYY, and */
/* tries to convert it on that basis, but if your format is different */
/* there may be trouble :-( Sorry, but that's life. You are, of */
/* course, welcome to change the script to suit your own format. */
/* */
/* Any queries, you can email me at dave@beames.demon.co.uk */
/*________________________________________________________________________*/
OPTIONS RESULTS
OPTIONS PROMPT ">>> "
MyPort="SCIONGEN"
ADDRESS VALUE MyPort
/*output = 'STDOUT'*/
filename = "RAM:WitnessList" /* change it if you want */
OPEN(w_file, filename, "w")
output = w_file
sep = ',' /* default to "comma" witness separator */
county = "LND" /* start by defaulting to "London" */
gettotalfgrn
total = result
WRITELN(stdout, "Please type your NAME and ADDRESS and press <RET>")
PARSE PULL myname
myname = " "myname
WRITELN(stdout, "")
WRITELN(stdout, "Please type your FHS-name/membership-number if any, and press <RET>")
PARSE PULL mysoc
DO x = 1 to total
getwitness x
IF result == "" THEN ITERATE /* Ignore marriage if no witnesses */
IF LEFT(result,1) == "*" THEN ITERATE /* or if prev listed */
witnesses = result
/* Get fixed data for this marriage */
getprincipal x
p = result
getspouse x
s = result
getsex s
IF result = "M" THEN
DO
t = s /* Put male partner first (sorry, ladies) */
s = p
p = t
END
principal = MakeName(p)
spouse = MakeName(s)
/* Validate date field, & compress if standard */
getmarrydate x
marrydate = result
PARSE VAR marrydate mday mmonth myear rest
lday = LENGTH(STRIP(mday))
IF lday < 3 & DATATYPE(mday, N) & mday < 32,
& LENGTH(STRIP(mmonth)) == 3 & DATATYPE(mmonth, M),
& LENGTH(STRIP(myear)) == 4 & DATATYPE(myear, N),
& rest == "" THEN
DO
IF lday == 1 THEN marrydate = "0"marrydate
marrydate = COMPRESS(marrydate)
END
/* Sort out "Church", "Place" & "County" as far as poss */
getmarryplace x
church = result
place = ""
IF church = "" THEN church = "Parish Church?"
ELSE DO
place = RIGHT(church, 19)
place = LEFT(STRIP(place), 20)
WRITELN(stdout, "This marriage took place at " church)
WRITELN(stdout, "Please type 3-letter county code -- default " county)
PULL newcounty
IF newcounty ~= "" THEN county = newcounty
END
/* Get variable data (ie witnesses) for this marriage */
/* & output n Witness Records */
witnesses = TRANSLATE(witnesses, sep, ';')
DO while witnesses ~= ""
PARSE var witnesses witname (sep) witnesses
fname = " "
DO forever
PARSE var witname namea witname
lname = namea
IF witname == "" THEN LEAVE
fname = fname namea
END
WRITECH(output, LEFT(STRIP(fname),19) LEFT(UPPER(STRIP(lname)),20))
WRITELN(output, LEFT(marrydate, 11) LEFT(church, 24))
WRITELN(output, principal place county)
WRITELN(output, spouse mysoc)
WRITELN(output, myname)
WRITELN(output, "")
END
END
EXIT
MakeName: /* Thanx to Peter Billing :) */
PARSE ARG irn
getfirstname irn
name = LEFT(result,19)
getlastname irn
name = name LEFT(result,19)
RETURN name